<template>
  <div>
    <el-form>
      <el-row :gutter="24">
        <el-col :span="8">
          <el-form-item label="PATH" required>
            <el-input
              v-model="spec.nfs.path"
              clearable
              placeholder="eg: /nfs-share"
            />
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="Server" required>
            <el-input
              v-model="spec.nfs.server"
              clearable
              placeholder="eg: 172.16.10.100"
            />
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="ReadOnly">
            <el-radio v-model="spec.nfs.readOnly" :label="true">Yes</el-radio>
            <el-radio v-model="spec.nfs.readOnly" :label="false">No</el-radio>
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
  </div>
</template>

<script setup lang="ts">
import { onMounted, ref } from "vue";

const spec = defineModel<any>("spec");

const nfsObj = ref({
  readOnly: true,
  server: "",
  path: ""
});

onMounted(() => {
  if (!spec.value.nfs) {
    spec.value.nfs = nfsObj.value;
  }
});
</script>

<style scoped></style>
